package com.ruoyi.cpsp.mapper;

import com.ruoyi.cpsp.domain.PerformanceHistory;
import com.ruoyi.cpsp.domain.PerformanceHistoryDept;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface PerformanceHistoryMapper {
    int deleteByPrimaryKey(@Param("id") Integer id);

    int insert(PerformanceHistory record);

    int insertSelective(PerformanceHistory record);

    PerformanceHistory selectByPrimaryKey(@Param("id") Integer id);

    int updateByPrimaryKeySelective(PerformanceHistory record);

    int updateByPrimaryKey(PerformanceHistory record);


    /**
     * 获取某员工某年某季度的绩效
     * @param map
     * @return
     */
    Double selectPerformance(Map<String, Object> map);

    /**
     * 更新某员工某季度的绩效
     * @param map
     */
    void updatePerformance(Map<String, Object> map);

    /**
     * 根据条件筛选绩效历史
     * 必填起始的年份和季度
     * 选填 员工 id、员工姓名、部门 id
     * @param map
     * @return
     */
    List<PerformanceHistory> selectPerformanceHistorys(Map<String, Object> map);

    /**
     * 根据属性插入处罚记录
     * @param year
     * @param quarter
     * @param employeeIdCard
     * @param performanceValue
     */
    void insertPerformanceHistory(@Param("year") Integer year, @Param("quarter") Integer quarter, @Param("employeeIdCard") String employeeIdCard, @Param("performanceValue") Double performanceValue);

    List<PerformanceHistory> selectPerformanceValue(@Param("year") Integer year, @Param("quarter") Integer quarter);

    List<PerformanceHistory> selectPerValueDepart(Integer year,Integer quarter,List<String> idCardList);

    List<PerformanceHistory> selectValueByOrder();

    List<PerformanceHistoryDept> selPerformanceByDept();

}
